home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update23.zoo / util / diffs
Encoding:
Text File  |  1992-07-21  |  5.4 KB  |  212 lines

  1. *** 1.29    1992/06/11 17:45:54
  2. --- Changelog    1992/07/21 14:55:32
  3. ***************
  4. *** 313,315 ****
  5. --- 313,322 ----
  6.       corectly not demangle C and other unmangled symbols.
  7.   
  8.   ----------------------------- Patchlevel 29 ---------------------------------
  9. + ar.c:: jean-marc jmz@obsbea.dnet.nasa.gov
  10. +     diff for BYTE_SWAP (for gcc-ar cross on a little endian host, now
  11. +     gcc-ar and gcc-ld are all set for cross work on a litle endian machine. 
  12. +     i suppose we should do rest of the utils too).
  13. + ----------------------------- Patchlevel 30 ---------------------------------
  14. *** 1.27    1992/06/11 17:45:54
  15. --- PatchLev.h    1992/07/21 14:55:34
  16. ***************
  17. *** 1,4 ****
  18. ! #define PatchLevel "29"
  19.   
  20.   /*
  21.    *    the Patch Level above is to identify the version
  22. --- 1,4 ----
  23. ! #define PatchLevel "30"
  24.   
  25.   /*
  26.    *    the Patch Level above is to identify the version
  27. *** 1.19    1991/09/24 17:30:39
  28. --- ar.c    1992/07/21 14:55:35
  29. ***************
  30. *** 92,97 ****
  31. --- 92,105 ----
  32.    You are forbidden to forbid anyone else to use, share and improve
  33.    what you give them.   Help stamp out software-hoarding!  */
  34.   
  35. + #ifdef BYTE_SWAP
  36. + #define SWAP4(y) (((unsigned)(y)>>24) + (((unsigned)(y)>>8)&0xff00) + \
  37. +          (((unsigned)(y)<<8)&0xff0000) + ((unsigned)(y)<<24)) 
  38. + #define SWAP2(y) ((((unsigned)(y)&0xff00)>>8) + (((unsigned)(y)&0x00ff)<<8))
  39. + #endif /* BYTE_SWAP */
  40.   #ifdef CROSSATARI
  41.   #ifdef USG
  42.   #define bcopy(a,b,c) memcpy (b,a,c)
  43. ***************
  44. *** 1563,1568 ****
  45. --- 1571,1579 ----
  46.     /* Write long containing number of symdefs.  */
  47.   
  48.     symdefs_size = nsymdefs * sizeof (struct symdef);
  49. + #ifdef BYTE_SWAP
  50. +   symdefs_size = SWAP4(symdefs_size);
  51. + #endif
  52.     write (outdesc, &symdefs_size, sizeof symdefs_size);
  53.   
  54.     /* Write symdefs surviving from old archive.  */
  55. ***************
  56. *** 1575,1580 ****
  57. --- 1586,1600 ----
  58.       {
  59.         if (mapptr->info.nsymdefs)
  60.       {
  61. + #ifdef BYTE_SWAP
  62. +       { register struct symdef *s = mapptr->info.symdefs;
  63. +         register int i;
  64. +         for(i = mapptr->info.nsymdefs; i; i--, s++) {
  65. +           s->s.stringoffset  = SWAP4(s->s.stringoffset);
  66. +           s->offset  = SWAP4(s->offset);
  67. +         }
  68. +       }
  69. + #endif
  70.         write (outdesc, mapptr->info.symdefs,
  71.            mapptr->info.nsymdefs * sizeof (struct symdef));
  72.       }
  73. ***************
  74. *** 1582,1588 ****
  75. --- 1602,1614 ----
  76.   
  77.     /* Write long containing string table size.  */
  78.   
  79. + #ifdef BYTE_SWAP
  80. +   new_strings_size = SWAP4(new_strings_size);
  81. + #endif
  82.     write (outdesc, &new_strings_size, sizeof new_strings_size);
  83. + #ifdef BYTE_SWAP
  84. +   new_strings_size = SWAP4(new_strings_size);
  85. + #endif
  86.   
  87.     /* Write string table  */
  88.   
  89. ***************
  90. *** 1660,1665 ****
  91. --- 1686,1701 ----
  92.       }
  93.   
  94.     len = read (indesc, &header, sizeof header);
  95. + #ifdef BYTE_SWAP
  96. +    header.a_info   = SWAP4(header.a_info);
  97. +    header.a_text   = SWAP4(header.a_text);
  98. +    header.a_data   = SWAP4(header.a_data);
  99. +    header.a_bss    = SWAP4(header.a_bss);
  100. +    header.a_syms   = SWAP4(header.a_syms);
  101. +    header.a_entry  = SWAP4(header.a_entry);
  102. +    header.a_trsize = SWAP4(header.a_trsize);
  103. +    header.a_drsize = SWAP4(header.a_drsize);
  104. + #endif
  105.     if (len != sizeof header)
  106.       error_with_file ("failure reading header of ", mapelt);
  107.     else if (N_BADMAG(header))
  108. ***************
  109. *** 1675,1681 ****
  110.       close (indesc);    /* We just opened it.  Give up */
  111.         return;
  112.       }
  113.     /* number of symbol entries in the file */
  114.     symcount = header.a_syms / sizeof (struct nlist);
  115.   
  116. --- 1711,1719 ----
  117.       close (indesc);    /* We just opened it.  Give up */
  118.         return;
  119.       }
  120. ! #ifdef BYTE_SWAP
  121. !   string_size = SWAP4(string_size);
  122. ! #endif
  123.     /* number of symbol entries in the file */
  124.     symcount = header.a_syms / sizeof (struct nlist);
  125.   
  126. ***************
  127. *** 1697,1702 ****
  128. --- 1735,1749 ----
  129.     if (indesc != archive_indesc)
  130.       close (indesc);
  131.   
  132. + #ifdef BYTE_SWAP
  133. +    { register struct nlist *from = symbols_and_strings;
  134. +      register struct nlist *end = symbols_and_strings + symcount;
  135. +      for(;from < end; from++) {
  136. +       from->n_un.n_strx = SWAP4(from->n_un.n_strx); 
  137. +       from->n_desc      = SWAP2(from->n_desc);
  138. +      }
  139. +    }
  140. + #endif /* BYTE_SWAP */
  141.     /* discard the symbols we don't want to mention; compact the rest down */
  142.   
  143.     symcount = filter_symbols (symbols_and_strings, symcount, strings);
  144. *** 1.5    1992/06/03 18:40:27
  145. --- fixstk.c    1992/07/21 14:55:36
  146. ***************
  147. *** 26,34 ****
  148.   extern char *malloc();
  149.   extern long lseek();
  150.   #define size_t unsigned long
  151.   #ifndef FILENAME_MAX
  152.   # define FILENAME_MAX 128
  153. - #endif
  154.   #endif
  155.   
  156.   #ifdef WORD_ALIGNED
  157. --- 26,35 ----
  158.   extern char *malloc();
  159.   extern long lseek();
  160.   #define size_t unsigned long
  161. + #endif
  162.   #ifndef FILENAME_MAX
  163.   # define FILENAME_MAX 128
  164.   #endif
  165.   
  166.   #ifdef WORD_ALIGNED
  167. *** 1.5    1992/06/03 18:40:27
  168. --- printstk.c    1992/07/21 14:55:39
  169. ***************
  170. *** 21,29 ****
  171.   extern char *malloc();
  172.   extern long lseek();
  173.   #define size_t unsigned long
  174.   #ifndef FILENAME_MAX
  175.   # define FILENAME_MAX 128
  176. - #endif
  177.   #endif
  178.   
  179.   #ifdef WORD_ALIGNED
  180. --- 21,30 ----
  181.   extern char *malloc();
  182.   extern long lseek();
  183.   #define size_t unsigned long
  184. + #endif
  185.   #ifndef FILENAME_MAX
  186.   # define FILENAME_MAX 128
  187.   #endif
  188.   
  189.   #ifdef WORD_ALIGNED
  190. *** 1.1    1989/06/12 23:27:26
  191. --- toglclr.c    1992/07/21 14:55:42
  192. ***************
  193. *** 12,17 ****
  194. --- 12,20 ----
  195.   #include <string.h>
  196.   #include <st-out.h>
  197.   
  198. + #ifndef FILENAME_MAX
  199. + #  define FILENAME_MAX 128
  200. + #endif
  201.   
  202.   int toggle (fd, fn)
  203.   int fd;
  204.